package com.lq.ecoldchain.ui.login

import android.arch.lifecycle.Observer
import com.lq.ecoldchain.base.CommonLoadingState
import com.lq.ecoldchain.base.CommonLoadingViewModel
import com.lq.ecoldchain.base.viewdelegate.BaseLoadingViewDelegate

/*
*2018/12/21 0021  14:22
*function by lq
*/
class LoginViewDelegate(val viewModel:LoginViewModel,loadingViewModel:CommonLoadingViewModel):BaseLoadingViewDelegate(loadingViewModel){

    init {
        viewModel.loadingLayout.observe(viewModel.lifecycleOwner!!,Observer<CommonLoadingState>{
            applyState(it!!)
        })
    }

    fun login() = viewModel.login()

}